<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>奚若出行平台</title>
    <base href="<?php echo RES_URL ?>"/>
    <meta name="viewport" content="width=device-width">
    <link href="<?php echo RES_URL?>/res/js/login/css/base.css" rel="stylesheet" type="text/css">
    <link href="<?php echo RES_URL?>/res/js/login/css/login.css" rel="stylesheet" type="text/css">
    <script src="<?php echo RES_URL?>/res/js/jquery/jquery.min.js"></script>
    <link href="<?php echo RES_URL?>/res/js/layui-v2.3.0/css/layui.css" rel="stylesheet">
    <script src="<?php echo RES_URL?>/res/js/layui-v2.3.0/layui.all.js"></script>
    <style>
        #main{background: url("/res/images/login/bg<?php echo mt_rand(1, 6)?>.jpg") no-repeat; background-size: 100% 100%;}
        .bg{width: 100%;height: 100%;position: fixed;left: 0;top:0;background: url("/res/images/login/tile.png") repeat;}
        .login{ z-index: 9999; }
    </style>
</head>
<body>
<div id="main">
    <div class="bg"></div>
    <div class="login">
        <div class="logo-name">奚若出行</div>
        <div class="line5"></div>
        <div class="caption">
            <div></div>
            <div></div>
            <span>平台管理</span>
        </div>
        <div class="account-box">
            <div class="line20"></div>
            <div class="line15"></div>
            <div class="txt">
                <input type="text" value="" id="account" placeholder="请输入账号"/>
            </div>
            <div class="line15"></div>
            <div class="txt">
                <input type="password" value="" id="pwd" placeholder="请输入密码"/>
            </div>
            <div class="line5"></div>
            <div class="line5"></div>
            <div class="tip" id="tip"></div>
            <div class="line20"></div>
            <div class="btn">
                <div onclick="app.login()">登录</div>
            </div>
        </div>
        <div style="text-align:center;margin-top:5px;"><a href='https://beian.miit.gov.cn' style="color:white" target="_blank">蜀ICP备2020026122号</a></div>
    </div>

</div>
</body>
</html>
<script>
    var tabIndex = 0;
    var app = {
        init: function () {
            $("input").keyup(function () {
                app.tip('');
            });
        },
        login: function () {
            var pdata = {
                account: $("#account").val(),
                pwd: $("#pwd").val(),
                code: $("#code").val()
            };
            $.post("<?php echo \yii\helpers\Url::to(['main/login'])?>?action=account", pdata, function (res) {
                if (res.flag) {
                    app.tip('登录成功');
                    setTimeout(function () {
                        location.href = "<?php echo isset($_GET['u']) ? $_GET['u'] : \yii\helpers\Url::to(['main/index'])?>";
                    }, 1800)
                } else
                    app.tip(res.msg);
            }, "json");
        },
        tip: function (msg) {
            $("#tip").html(msg);
        }
    };

    app.init();
</script>